package com.itheima.job1;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Test {
    public static void main(String[] args) {
        List<String> one = new ArrayList<>();
        one.add("黄老邪");
        one.add("陈玄风");
        one.add("梅超风");
        one.add("陆乘风");
        one.add("曲灵风");
        one.add("武眠风");
        one.add("冯默风");
        one.add("罗玉风");
        List<String> two = new ArrayList<>();
        two.add("张三丰");
        two.add("宋远桥");
        two.add("俞莲舟");
        two.add("俞岱岩");
        two.add("张松溪");
        two.add("张翠山");
        two.add("殷梨亭");
        two.add("莫声谷");
        // ....
        //第一个队名字为三个字的成员
        Stream<String> part1 = one.stream()
                .filter((String s) -> s.length() == 3)
                .limit(3);
        Stream<String> part2 = two.stream()
                .filter(s -> s.startsWith("张"))
                .skip(2);
        List<String> collect = Stream.concat(part1, part2).collect(Collectors.toList());
        List<Person> persons = new ArrayList<>();
        for (String s : collect) {
            persons.add( new Person(s));
        }
        persons.forEach(s-> System.out.println(s));


    }
}
